package myjava;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	// write your code here
    cal js=new cal();
    js.cal();
    }
}
class cal{
    public static float jia(float x,float y){
        return x+y;
    }
    public static float jian(float x,float y){
        return x+y;
    }
    public static float cheng(float x,float y){
        return x+y;
    }
    public static float chu(float x,float y){
        return x+y;
    }

    public static void cal(){
        System.out.print("输入第1个数字：");
        Scanner sc1= new Scanner(System.in);
        float number1=sc1.nextFloat();
        System.out.println("输入方法：+-*/");
        Scanner sc=new Scanner(System.in);
        String mathor= sc.nextLine();
        System.out.print("输入第2个数字：");
        Scanner sc2= new Scanner(System.in);
        float number2=sc2.nextFloat();

        switch (mathor){
            case "+" :
                System.out.println(number1+"加上"+number2+"="+jia(number1,number2));
                break;
            case "-":
                System.out.println(number1+"减去"+number2+"="+jian(number1,number2));
                break;
            case "*":
                System.out.println(number1+"乘以"+number2+"="+cheng(number1,number2));
                break;
            case "/":
                System.out.println(number1+"乘以"+number2+"="+chu(number1,number2));
                break;


        }

    }
}
